package com.dinzeer.slashblade_useful_addon.mixin;

import com.dinzeer.slashblade_useful_addon.config.Config;
import mods.flammpfeil.slashblade.entity.EntitySlashEffect;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(EntitySlashEffect.class)
public class SlashEffectMixin {

    @Shadow private double damage;

    @Inject(method = "setDamage", at = @At("HEAD"), cancellable = true, remap = false)
    private void onSetDamage(double damageIn, CallbackInfo ci) {
            this.damage= Config.ATTACK_MODIFIER_FACTOR_ForSlashEffect.get()+damageIn;
            ci.cancel();

    }


}
